home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / lang / amigatalk.lha / intuition / GadgetFlags.st < prev    next >
Text File  |  2002-03-15  |  3KB  |  69 lines

  1. " -------------------------------------------------------------------- "
  2. " GadgetFlags Class is a Singleton class that allows the user to       "
  3. " reference Gadget Flags without having to remember their actual       "
  4. " hexadecimal values.                                                  "
  5. ""
  6. " The User does NOT need to create one of these, since Intuition Class "
  7. " will instantiate the only needed instance of this Class.  See the    "
  8. " SetupIntuition.st source file for the method(s) that help the User   "
  9. " with this Class.                                                     "
  10. ""
  11. "   EXAMPLE:  'myTag <- intuition getGadgetFlag: #GFLG_GADGHCOMP'      "
  12. ""
  13. " ALL singleton classes MUST contain the following:                    "
  14. ""
  15. "   the methods:  isSingleton AND privateSetup     AND                 "
  16. "                 uniqueInstance Class instance variable.              "
  17. " -------------------------------------------------------------------- "
  18.  
  19. Class GadgetFlags :Dictionary ! uniqueInstance ! 
  20. [
  21.    isSingleton
  22.      ^ true  
  23. |  
  24.    privateNew ! newinstance !
  25.      newinstance <- super new.
  26.  
  27.      ^ newinstance
  28. |
  29.    new
  30.      ^ (self privateSetup)
  31. |
  32.    privateSetup
  33.      (uniqueInstance isNil)
  34.        ifTrue: [uniqueInstance <- self privateNew.
  35.  
  36.                 " Describe the highlight technique to be used:"
  37.  
  38.                 self at: #GFLG_GADGHCOMP    put: 0.
  39.                 self at: #GFLG_GADGHIGHBITS put: 3. "2r0011 For masking."
  40.                 self at: #GFLG_GADGHBOX     put: 1.
  41.                 self at: #GFLG_GADGHIMAGE   put: 2.
  42.                 self at: #GFLG_GADGHNONE    put: 3.
  43.  
  44.                 self at: #GFLG_GADGIMAGE    put: 4.
  45.  
  46.                 self at: #GFLG_RELBOTTOM    put: 8.
  47.                 self at: #GFLG_RELRIGHT     put: 16r10.
  48.                 self at: #GFLG_RELWIDTH     put: 16r20.
  49.                 self at: #GFLG_RELHEIGHT    put: 16r40.
  50.  
  51.                 self at: #GFLG_SELECTED     put: 16r80.
  52.  
  53.                 self at: #GFLG_DISABLED     put: 16r100.
  54.                 self at: #GFLG_TABCYCLE     put: 16r200.
  55.                 self at: #GFLG_STRINGEXTEND put: 16r400.
  56.                 self at: #GFLG_IMAGEDISABLE put: 16r800.
  57.  
  58.                 self at: #GFLG_LABELMASK    put: 16r3000. "For masking."
  59.                 self at: #GFLG_LABELITEXT   put: 0.
  60.                 self at: #GFLG_LABELSTRING  put: 16r1000.
  61.                 self at: #GFLG_LABELIMAGE   put: 16r2000.
  62.  
  63.                 self at: #GFLG_RELSPECIAL   put: 16r4000.
  64.                 self at: #GFLG_EXTENDED     put: 16r8000.
  65.                ].
  66.                 
  67.      ^ self "uniqueInstance??"
  68. ]
  69.